//package com.sugon.cloudgateway.filter;
//
//import lombok.Data;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.lang.StringUtils;
//import org.springframework.cloud.gateway.filter.GatewayFilterChain;
//import org.springframework.cloud.gateway.filter.GlobalFilter;
//import org.springframework.core.Ordered;
//import org.springframework.http.HttpStatus;
//import org.springframework.stereotype.Component;
//import org.springframework.web.server.ServerWebExchange;
//import reactor.core.publisher.Mono;
//
//import java.util.Date;
//
///**
// * @author 15989
// * @description: 自定义全局过滤器
// * @since 2023/2/24
// */
//@Component
//@Slf4j
//public class MyLogGatewayFilter implements GlobalFilter, Ordered {
//
//    @Override
//    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
//        log.info("******come in MyLogGateWayFilter*****"+new Date());
////        String username = exchange.getRequest().getQueryParams().getFirst("username");
////        if (StringUtils.isEmpty(username) || !"admin".equals(username)) {
////            log.info("非法用户");
////            exchange.getResponse().setStatusCode(HttpStatus.FORBIDDEN);
////            return exchange.getResponse().setComplete();
////        }
//
//        return chain.filter(exchange);
//    }
//
//    @Override
//    public int getOrder() {
//        return 0;
//    }
//}
